<template>
	<view>
		<cu-custom bgColor="bg-purple" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">授权列表</block>
		</cu-custom>
		
		<view class="cu-list menu-avatar">
			<view class="cu-item" v-for="(item,index) in auths" :key="index">
				<view class="cu-avatar round lg" v-for="(item2,index2) in modules" v-if="item2.id==item.openmodule_id" :key="index2" :style="{backgroundImage:'url('+item2.logoimage+');'}"></view>
				<view class="content">
					<view class="text-grey">
						<view class="text-cut">{{item.name}}</view>
						<view class="cu-tag round bg-orange sm">{{item.site}}</view>
					</view>
					<view class="text-gray text-sm flex">
						<view class="text-cut">
							
							订单号:{{item.ordersn}}
						</view> </view>
				</view>
				<view class="action">
					<view class="cu-tag round  sm " :class="statusarr[item.status].color">{{statusarr[item.status].text}}</view>
					<view class="text-grey text-xs">坑位:{{item.application}}</view>
					<!-- <view class="cu-tag round bg-grey sm"></view> -->
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				auths:[],
				modules:[],
				statusarr:[
				  {
					color:'bg-grey',
					text:'审核中'
				  },
				  {
					color: 'bg-green',
					text:'正常'
				  },
				  {
					color: 'bg-yellow',
					text:'拒绝'
				  }
				  
				]
			}
		},
		onLoad() {
			this.getlist()
		},
		methods: {
			// 获取授权列表
			getlist(){
				this.util.csAjax('/addons/open/wxapp.open/auth',{},(ret)=>{
					console.log(ret)
					this.auths = ret.data.auths
					this.modules = ret.data.modules
				})
			}
		}
	}
</script>

<style>

</style>
